﻿<Window x:Class="CharacterCreation.MainView"
    xmlns:views="clr-namespace:CharacterCreation.Views"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="clr-namespace:CharacterCreation.Controls"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400" WindowState="Normal" WindowStartupLocation="CenterScreen" Title="Character Creation - v1.09" 
        Icon="/Images/ctron_vragenbank_32.png" MinWidth="1024" MinHeight="768" Width="1024" Height="768">

    <Grid Background="{StaticResource backgroundBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Grid Background="#FFC2CCDB" Margin="2">
            <TextBlock Text="{Binding SelectedView.HeaderText}" HorizontalAlignment="Left" VerticalAlignment="Center"
                       FontFamily="Georgia" FontSize="26" Foreground="White" Margin="20,10,20,10" FontWeight="Bold"/>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="5" Visibility="{Binding SelectedView.CommandButtonsVisibility}">
                <Button Command="{Binding SelectedView.ExportCommand}" ToolTip="Export" Style="{StaticResource actionButton}">
                    <Image Height="26" Source="/Images/ctron_beheerder_32.png" VerticalAlignment="Center" />
                </Button>
                <Button Command="{Binding SelectedView.AddCommand}" ToolTip="Add" Style="{StaticResource actionButton}">
                    <Image Height="26" Source="/Images/ctron_add_26.png" VerticalAlignment="Center" />
                </Button>
                <Button Command="{Binding SelectedView.DeleteCommand}" ToolTip="Delete" Style="{StaticResource actionButton}">
                    <Image Height="26" Source="/Images/ctron_delete_26.png" VerticalAlignment="Center" />
                </Button>
                <Button Command="{Binding SelectedView.EditCommand}" ToolTip="Edit" Style="{StaticResource actionButton}">
                    <Image Height="26" Source="/Images/ctron_edit_26.png" VerticalAlignment="Center" />
                </Button>
                <Button Command="{Binding SelectedView.SaveCommand}" ToolTip="Save" Style="{StaticResource actionButton}">
                    <Image Height="26" Source="/Images/ctron_save_38.png" VerticalAlignment="Center" />
                </Button>
            </StackPanel>
        </Grid>

        <ContentControl Content="{Binding SelectedView}" Grid.Row="1" />

        <ListBox Grid.Row="2" ItemsSource="{Binding HostViews}" SelectedItem="{Binding SelectedView, Mode=TwoWay}" Background="#FFADB9CD">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal" Margin="10" HorizontalAlignment="Left" VerticalAlignment="Center" />
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>

            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Image Source="{Binding ViewImage}" Margin="10,0,10,0" Height="32" Width="32" ToolTip="{Binding HeaderText}" Cursor="Hand" />
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>


    </Grid>
</Window>
